home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / prog / sgyacc.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1993-06-20  |  15.5 KB  |  709 lines

  1. #! /bin/sh
  2. # This is a shell archive, meaning:
  3. # 1. Remove everything above the #! /bin/sh line.
  4. # 2. Save the resulting text in a file.
  5. # 3. Execute the file with /bin/sh (not csh) to create:
  6. #    filter80.c
  7. #    makefile
  8. #    readme
  9. #    sgexe.c
  10. #    sgl.l
  11. #    sgy.y
  12. # This archive created: Fri Apr  3 21:06:02 1992
  13. export PATH; PATH=/bin:/usr/bin:$PATH
  14. if test -f 'filter80.c'
  15. then
  16.     echo shar: "will not over-write existing file 'filter80.c'"
  17. else
  18. cat << \SHAR_EOF > 'filter80.c'
  19. /*    FILTER80.C
  20.     Compile with "cc -o filter80 filter80.c"
  21.     The execute-able file is then "filter80"...
  22.     Run the program with "filter80 <inputfile>"
  23.     The file "<inputfile>" must be in the default directory...  i.e. "."
  24. */
  25. #include    <stdio.h>
  26. #include    <ctype.h>
  27. main (argc, argv)
  28. int argc;
  29. char **argv;
  30. {
  31.     int    linecnt=0;
  32.     int    MAXCOL=70;
  33.     char    achar;
  34.     FILE    *pfile;
  35.     FILE    *fopen();
  36.  
  37.     if ( argc <= 1 ) {
  38.         printf( "Strip all control characters from a file.\n");
  39.         printf( "USAGE: %s <inputfile>\n", argv[0] );
  40.         exit(0);
  41.     }
  42.  
  43.     pfile = fopen( argv[1], "r" );            /*open for read only*/
  44.     if ( pfile == NULL ) {
  45.         printf( "FOPEN of %s failed!!\n", argv[1] );
  46.         exit(0);
  47.     }
  48.     achar = EOF+1;        /*Initialize so-as not = EOF*/
  49.  
  50.     while (achar != EOF) {
  51.         achar = getc( pfile );
  52.  
  53.         /* strip control char's and limit lines to MAXCOL (80?) */
  54.         if( ! iscntrl(achar) && achar != EOF ) {
  55.             linecnt++;
  56.             switch( achar ) {
  57.                 case ';':
  58.                 case '(':
  59.                 case '[':
  60.                     if( linecnt > (MAXCOL) ) {
  61.                         linecnt = 0;
  62.                         printf( "\n" );
  63.                     } /*end if*/
  64.                     break;
  65.             } /*end switch*/
  66.  
  67.             printf( "%c", achar );
  68.  
  69.             switch( achar ) {
  70.                 case ')':
  71.                 case ' ':
  72.                 case ']':
  73.                     if( linecnt > (MAXCOL) ) {
  74.                         linecnt = 0;
  75.                         printf( "\n" );
  76.                     } /*end if*/
  77.                     break;
  78.             } /*end switch*/
  79.         } else {
  80.             switch( achar ) {
  81.                 case '\n':
  82.                     linecnt = 0;
  83.                     printf( "%c", achar );
  84.                     break;
  85.                 case '\t':
  86.                     printf( "%c", achar );
  87.                     break;
  88.             } /*end switch*/
  89.         } /*end if-else*/
  90.     } /*end while*/
  91. } /*end main*/
  92. SHAR_EOF
  93. fi
  94. if test -f 'makefile'
  95. then
  96.     echo shar: "will not over-write existing file 'makefile'"
  97. else
  98. cat << \SHAR_EOF > 'makefile'
  99. #  makefile for building c objects and linking c program for LEX
  100.  
  101.  
  102. #    ALL  modules
  103.  
  104. all:    sgexe filter80
  105.  
  106. #    LEX/YACC modules
  107.  
  108. filter80:    filter80.o
  109.         cc -o filter80 filter80.o
  110.  
  111. sgexe:        sgexe.o y.tab.o lex.yy.o
  112.         cc -o sgexe sgexe.o y.tab.o lex.yy.o
  113.  
  114. sgexe.o:    sgexe.c
  115.  
  116. lex.yy.o:    lex.yy.c y.tab.h
  117.  
  118. lex.yy.c:    sgl.l
  119.         lex sgl.l
  120.  
  121. sgy.o:        sgy.c
  122.  
  123. y.tab.o:    y.tab.c
  124.  
  125. y.tab.c:    sgy.y
  126.         yacc -d sgy.y
  127. SHAR_EOF
  128. fi
  129. if test -f 'readme'
  130. then
  131.     echo shar: "will not over-write existing file 'readme'"
  132. else
  133. cat << \SHAR_EOF > 'readme'
  134. Here are some files that I hacked out while working on a 
  135. Neural Network Go playing program.
  136.  
  137. This may be a start for anyone needing to parse the Smart-Go format.
  138.  
  139. NOTICE: THIS IS NOT A SMART-GO GRAMMAR DEFINITION.
  140.  
  141. I started from a formal definition of the Smart-Go format.
  142. However, I changed the grammar, as necessary, to parse actual games.
  143. Additionally, the grammar was simplified if particular commands or 
  144. parameters were not needed for my application.  This particular 
  145. parser performs no usefull function, since I backed out most 
  146. of my 'user defined' C code.
  147.  
  148. Filter80 is a simple program to truncate the possibly long lines
  149. in the Smart-Go format.  This parser will choke on long lines.  Long
  150. in this case is defined to be something over 80, probably around 250.
  151.  
  152. The following are some listings and 'sum's on this UNIX machine.
  153.  
  154. long listing:
  155.  
  156. -rw-------  1 jconley      1508 Mar  1 00:08 filter80.c
  157. -rw-------  1 jconley       386 Apr  3 23:11 makefile
  158. -rw-------  1 jconley       558 Apr  1 16:39 sgexe.c
  159. -rw-------  1 jconley      5637 Apr  3 22:55 sgl.l
  160. -rw-------  1 jconley      5392 Apr  3 22:54 sgy.y
  161.  
  162. sum *:
  163.  
  164. 40985     2 filter80.c
  165. 38372     1 makefile
  166. 59209     1 sgexe.c
  167. 35757     6 sgl.l
  168. 09611     6 sgy.y
  169. SHAR_EOF
  170. fi
  171. if test -f 'sgexe.c'
  172. then
  173.     echo shar: "will not over-write existing file 'sgexe.c'"
  174. else
  175. cat << \SHAR_EOF > 'sgexe.c'
  176. /*
  177.  * Copyright 1988, 1989 Mortice Kern Systems Inc.
  178.  * All rights reserved.
  179.  */
  180. #include <stdio.h>
  181. #include <stdlib.h>
  182. #include <string.h>
  183.  
  184. #define    FALSE    0
  185. #define    TRUE    1
  186.  
  187. #ifndef YYSTYPE
  188. #define YYSTYPE int
  189. #endif
  190.  
  191. YYSTYPE    yylval;                /* yylex() sets this */
  192. int    yylineno;
  193.  
  194. int errcnt;            /* used in yyparse */
  195. int sglevel;            /* used in yyparse */
  196. int gamecnt;            /* used in yyparse */
  197. FILE *fpm;            /* used in sgy.y */
  198. int PRINTOFF;            /* used in sgy.y */
  199.  
  200. main()
  201. {
  202.     int lexrtn;
  203.  
  204.     errcnt = 0;
  205.     printf( "Calling yyparse()\n" );
  206.     lexrtn = yyparse();
  207.  
  208.     exit();
  209. }
  210. SHAR_EOF
  211. fi
  212. if test -f 'sgl.l'
  213. then
  214.     echo shar: "will not over-write existing file 'sgl.l'"
  215. else
  216. cat << \SHAR_EOF > 'sgl.l'
  217. D            [0-9]
  218. coord            [a-t]
  219.  
  220. %{
  221. /*    DEFN - sgl.l        Smart-Go lexicon */
  222. #include <stdio.h>
  223. #include "y.tab.h"
  224.  
  225. /* void count( void );    Prototype */
  226. #undef    YYLMAX
  227. #define    YYLMAX    2048
  228. #undef    output(c)
  229. #define    output(c)    /* no output from from yacc/lex */
  230.  
  231. int column;        /* Global variable used in the function count() */
  232. %}
  233.  
  234. %%
  235. {D}+            { count(); return(NUMBER); }
  236. {D}*"."{D}+        { count(); return(REALNUM); }
  237.  
  238. \"(\\.|[^\\"])*\"    { count(); return(STRING); }
  239.  
  240. {coord}{coord}        { count(); return(POINT); }
  241.  
  242. "?"            { count(); return('?'); }
  243. ":"            { count(); return(':'); }
  244. ";"            { count(); return(';'); }
  245. "("            { count(); return('('); }
  246. ")"            { count(); return(')'); }
  247. "["            { count(); return('['); }
  248. "]"            { count(); return(']'); }
  249. "-"            { count(); return('-'); }
  250. "+"            { count(); return('+'); }
  251.  
  252. "AB"            { count(); return(AB); }
  253. "AddBlack"        { count(); return(AB); }
  254. "AE"            { count(); return(AE); }
  255. "AddEmpty"        { count(); return(AE); }
  256. "AN"            { count(); return(AN); }
  257. "AW"            { count(); return(AW); }
  258. "AddWhite"        { count(); return(AW); }
  259. "B"            { count(); return(B); }
  260. "Black"            { count(); return(B); }
  261. "BL"            { count(); return(BL); }
  262. "BlackLeft"        { count(); return(BL); }
  263. "BM"            { count(); return(BM); }
  264. "BadMove"        { count(); return(BM); }
  265. "BR"            { count(); return(BR); }
  266. "BlackRank"        { count(); return(BR); }
  267. "BS"            { count(); return(BS); }
  268. "BlackSpec"        { count(); return(BS); }
  269. "C"            { count(); return(C); }
  270. "Comment"        { count(); return(C); }
  271. "CH"            { count(); return(CH); }
  272. "CHeck"            { count(); return(CH); }
  273. "CM"            { count(); return(CM); }
  274. "CP"            { count(); return(CP); }
  275. "DG"            { count(); return(DG); }
  276. "DT"            { count(); return(DT); }
  277. "DaTe"            { count(); return(DT); }
  278. "EG"            { count(); return(EG); }
  279. "EL"            { count(); return(EL); }
  280. "EvaLuation"        { count(); return(EL); }
  281. "EV"            { count(); return(EV); }
  282. "EVent"            { count(); return(EV); }
  283. "EX"            { count(); return(EX); }
  284. "EXpected"        { count(); return(EX); }
  285. "FF"            { count(); return(FF); }
  286. "FileFormat"        { count(); return(FF); }
  287. "FG"            { count(); return(FG); }
  288. "FiGure"        { count(); return(FG); }
  289. "GB"            { count(); return(GB); }
  290. "GoodBlack"        { count(); return(GB); }
  291. "GC"            { count(); return(GC); }
  292. "GameComment"        { count(); return(GC); }
  293. "GM"            { count(); return(GM); }
  294. "GaMe"            { count(); return(GM); }
  295. "GN"            { count(); return(GN); }
  296. "GameName"        { count(); return(GN); }
  297. "GW"            { count(); return(GW); }
  298. "GoodWhite"        { count(); return(GW); }
  299. "HA"            { count(); return(HA); }
  300. "HAndicap"        { count(); return(HA); }
  301. "HO"            { count(); return(HO); }
  302. "KI"            { count(); return(KI); }
  303. "KomI"            { count(); return(KI); }
  304. "KM"            { count(); return(KI); }
  305. "KoMi"            { count(); return(KI); }
  306. "L"            { count(); return(L); }
  307. "Letter"        { count(); return(L); }
  308. "LB"            { count(); return(LB); }
  309. "LaBel"            { count(); return(LB); }
  310. "M"            { count(); return(M); }
  311. "Mark"            { count(); return(M); }
  312. "N"            { count(); return(N); }
  313. "Node"            { count(); return(N); }
  314. "Name"            { count(); return(N); }
  315. "NB"            { count(); return(NB); }
  316. "NW"            { count(); return(NW); }
  317. "OE"            { count(); return(OE); }
  318. "ON"            { count(); return(ON); }
  319. "OS"            { count(); return(OS); }
  320. "PB"            { count(); return(PB); }
  321. "PlayerBlack"        { count(); return(PB); }
  322. "PC"            { count(); return(PC); }
  323. "PlaCe"            { count(); return(PC); }
  324. "PL"            { count(); return(PL); }
  325. "PLayer"        { count(); return(PL); }
  326. "PW"            { count(); return(PW); }
  327. "PlayerWhite"        { count(); return(PW); }
  328. "RE"            { count(); return(RE); }
  329. "REsult"        { count(); return(RE); }
  330. "RG"            { count(); return(RG); }
  331. "ReGion"        { count(); return(RG); }
  332. "RO"            { count(); return(RO); }
  333. "ROund"            { count(); return(RO); }
  334. "SC"            { count(); return(SC); }
  335. "SeCure"        { count(); return(SC); }
  336. "SL"            { count(); return(SL); }
  337. "SeLected"        { count(); return(SL); }
  338. "SO"            { count(); return(SO); }
  339. "SOurce"        { count(); return(SO); }
  340. "SZ"            { count(); return(SZ); }
  341. "SiZe"            { count(); return(SZ); }
  342. "Size"            { count(); return(SZ); }
  343. "TB"            { count(); return(TB); }
  344. "TerritoryBlack"    { count(); return(TB); }
  345. "TC"            { count(); return(TC); }
  346. "TE"            { count(); return(TE); }
  347. "TEsuji"        { count(); return(TE); }
  348. "TM"            { count(); return(TM); }
  349. "TiMe"            { count(); return(TM); }
  350. "TR"            { count(); return(TR); }
  351. "TW"            { count(); return(TW); }
  352. "TerritoryWhite"    { count(); return(TW); }
  353. "US"            { count(); return(US); }
  354. "USer"            { count(); return(US); }
  355. "V"            { count(); return(V); }
  356. "Value"            { count(); return(V); }
  357. "VW"            { count(); return(VW); }
  358. "VieW"            { count(); return(VW); }
  359. "W"            { count(); return(W); }
  360. "White"            { count(); return(W); }
  361. "WL"            { count(); return(WL); }
  362. "WhiteLeft"        { count(); return(WL); }
  363. "WR"            { count(); return(WR); }
  364. "WhiteRank"        { count(); return(WR); }
  365. "WS"            { count(); return(WS); }
  366. "WhiteSpec"        { count(); return(WS); }
  367.  
  368. "A"            { count(); return(MARKER); }
  369. "D"            { count(); return(MARKER); }
  370. "E"            { count(); return(MARKER); }
  371. "F"            { count(); return(MARKER); }
  372. "G"            { count(); return(MARKER); }
  373. "H"            { count(); return(MARKER); }
  374. "I"            { count(); return(MARKER); }
  375. "J"            { count(); return(MARKER); }
  376. "K"            { count(); return(MARKER); }
  377. "O"            { count(); return(MARKER); }
  378. "P"            { count(); return(MARKER); }
  379. "Q"            { count(); return(MARKER); }
  380. "R"            { count(); return(MARKER); }
  381. "S"            { count(); return(MARKER); }
  382. "T"            { count(); return(MARKER); }
  383. "U"            { count(); return(MARKER); }
  384. "X"            { count(); return(MARKER); }
  385. "Y"            { count(); return(MARKER); }
  386. "Z"            { count(); return(MARKER); }
  387.  
  388. \\.            { count(); return(UNKNOWN); }
  389. .            { count(); return(UNKNOWN); }
  390. %%
  391.  
  392.  
  393. yywrap()
  394. {
  395.     return(1);
  396. }
  397.  
  398.  
  399. int count()
  400. {
  401.     int i;
  402.  
  403.     for (i = 0; yytext[i] != '\0'; i++)
  404.         if (yytext[i] == '\n')
  405.             column = 0;
  406.         else if (yytext[i] == '\t')
  407.             column += 8 - (column % 8);
  408.         else
  409.             column++;
  410.  
  411.     /*ECHO;*/
  412. } /*end count()*/
  413. SHAR_EOF
  414. fi
  415. if test -f 'sgy.y'
  416. then
  417.     echo shar: "will not over-write existing file 'sgy.y'"
  418. else
  419. cat << \SHAR_EOF > 'sgy.y'
  420. /* CCAGO */
  421. /* This YACC file reads any Smart-Go game record. */
  422. /* Only a few moves are important and passed on to the output. */
  423. /* These moves are Black/White moves and any stone placements. */
  424. /* The idea here is an intermediate step for trimming down a game record */
  425. /*   to only the important moves, for the CCAGO system. */
  426. /* */
  427. %token UNKNOWN STRING REALNUM NUMBER POINT MARKER
  428. %token B W C N V CH GB GW TE BM BL WL FG AB AW AE PL GN GC EV RO
  429. %token DT PC PB PW RE US TM SO RO TB TW SC RG EL EX SL M L
  430. %token GM SZ VW BS WS BR WR HA ON TC LB HO TR DG
  431.  
  432. %token KI FF CP AN OE OS CM NB NW EG
  433. %start init
  434.  
  435. %{
  436. /* CCAGO stuff */
  437. #include <stdio.h>
  438. #include <stdlib.h>
  439. #include <string.h>
  440.  
  441. #define    FALSE    0
  442. #define    TRUE    1
  443. extern int PRINTOFF;
  444. extern int errcnt;
  445. extern int sglevel;
  446. extern int gamecnt;
  447. /* end CCAGO stuff */
  448. %}
  449.  
  450. %%
  451.  
  452. init
  453.     :                 { gamecnt=0;
  454.                       PRINTOFF=FALSE; }
  455.       collection
  456.     ;
  457.  
  458. collection
  459.     :                 { printf("\nCollection start\n"); }
  460.       gametree collection
  461.     | /*null*/
  462.     ;
  463.  
  464. gametree
  465.     : '('                 { gamecnt++;
  466.                       sglevel=1;
  467.                       printf("\nNew Game%d\n", gamecnt );
  468.                       printf("\n%s", yytext );
  469.                     }
  470.       sequence ')'             { sglevel=0;
  471.                       printf("\nEnd Game%d\n", gamecnt );
  472.                       printf("%s\n", yytext );
  473.                     }
  474.     ;
  475.  
  476. sequence
  477.     : sequence node
  478.     | /*null*/
  479.     ;
  480.  
  481. node
  482.     : ';' proplist
  483.     | variation
  484.     ;
  485.  
  486. variation
  487.     : '('                 { sglevel++;
  488.                       printf("\nLevel=%d\n", sglevel );
  489.                       printf("\n%s", yytext );
  490.                     }
  491.       sequence ')'             { sglevel--;
  492.                       printf("\nLevel=%d\n", sglevel );
  493.                       printf("%s\n", yytext );
  494.                     }
  495.     ;
  496.  
  497. proplist
  498.     : proplist property
  499.     | /*null*/
  500.     ;
  501.  
  502. pointlist
  503.     : /*null*/
  504.     | '['                { if(!PRINTOFF)
  505.                         printf("%s", yytext ); }
  506.         apoint
  507.         ']'             { if(!PRINTOFF)
  508.                         printf("%s", yytext ); }
  509.         pointlist
  510.     ;
  511.  
  512. apoint
  513.     : POINT             { if(!PRINTOFF)
  514.                         printf("%s", yytext ); }
  515.     | num
  516.     | error
  517.     ;
  518.  
  519. labellist
  520.     : '[' POINT ':' marker ']' labellist
  521.     | '[' POINT ':' marker ']'
  522.     | '[' error ']'
  523.     ;
  524.  
  525. marker
  526.     : MARKER
  527.     | B
  528.     | C
  529.     | L
  530.     | M
  531.     | N
  532.     | V
  533.     | W
  534.     | UNKNOWN
  535.     ;
  536.  
  537. textval
  538.     : error 
  539.     | /*null*/
  540.     ;
  541.  
  542. moveval
  543.     : POINT
  544.     | /*null*/
  545.     ;
  546.  
  547. tripleval    
  548.     : inumval
  549.     ;
  550.  
  551. colorval
  552.     : B
  553.     | W
  554.     ;
  555.  
  556. inumval
  557.     : num                { $$ = $1; }
  558.     | '+' num            { $$ = $2; }
  559.     | '-' num            { $$ = 0 - $2; }
  560.     ;
  561.  
  562. realval
  563.     : num                { $$ = $1; }
  564.     | '+' num            { $$ = $2; }
  565.     | '-' num            { $$ = 0 - $2; }
  566.     ;
  567.  
  568. num
  569.     : REALNUM            { $$ = atof(yytext); }
  570.     | NUMBER            { $$ = atoi(yytext); }
  571.     | '?'                { $$ = 0; }
  572.     | /*null*/
  573.     ;
  574.  
  575. property
  576.     : AB                { printf(";B"); }
  577.         pointlist
  578.     | AE                { printf(";AE"); }
  579.         pointlist
  580.     | AN '[' textval ']'
  581.     | AW                { printf(";W"); }
  582.         pointlist
  583.     | B                { printf(";B"); }
  584.         pointlist
  585.     | BL '[' realval ']'
  586.     | BM '[' tripleval ']'
  587.     | BR '[' textval ']'
  588.     | BS '[' textval ']'
  589.     | C  '[' textval ']'
  590.     | CH '[' tripleval ']'
  591.     | CM '[' textval ']'
  592.     | CP '[' textval ']'
  593.     | DG '[' ']'
  594.     | DT '[' textval ']'
  595.     | EG                { PRINTOFF = TRUE; } /* ?? */
  596.         pointlist
  597.                     { PRINTOFF = FALSE; }
  598.     | EL '[' inumval ']'
  599.     | EV '[' textval ']'
  600.     | EX '[' moveval ']'
  601.     | FF '[' textval ']'
  602.     | FG '[' ']'
  603.     | GB '[' tripleval ']'
  604.     | GC '[' textval ']'
  605.     | GM '[' inumval ']'
  606.     | GN '[' textval ']'
  607.     | GW '[' tripleval ']'
  608.     | HA '[' inumval ']'         { switch( $3 ){
  609.                         /* verify case 1: !! */
  610.                         case 9: printf(";B[jj]");
  611.                         case 8: printf(";B[dj]");
  612.                             printf(";B[pj]");
  613.                         case 6: printf(";B[jd]");
  614.                             printf(";B[jp]");
  615.                         case 4: printf(";B[dj]");
  616.                         case 3: printf(";B[po]");
  617.                         case 2: printf(";B[pp]");
  618.                         case 1: printf(";B[pd]");
  619.                             break;
  620.                         case 7: printf(";B[jd]");
  621.                             printf(";B[jp]");
  622.                         case 5: printf(";B[jj]");
  623.                             printf(";B[dd]");
  624.                             printf(";B[dp]");
  625.                             printf(";B[pd]");
  626.                             printf(";B[pp]");
  627.                             break;
  628.                         }/*end switch*/
  629.                     }/*end code*/
  630.     | HO '[' ']'
  631.     | KI '[' textval ']'        /*komi*/
  632.     | L                { PRINTOFF = TRUE; } /*letters points */
  633.         pointlist
  634.                     { PRINTOFF = FALSE; }
  635.     | LB labellist            /*label*/
  636.     | M                  { PRINTOFF=TRUE; }    /* Mark?? */
  637.         pointlist 
  638.                       { PRINTOFF=FALSE; }
  639.     | N  '[' textval ']'        /*node*/
  640.     | NB '[' inumval ']'
  641.     | NW '[' inumval ']'
  642.     | OE '[' textval ']'
  643.     | ON '[' textval ']'
  644.     | OS '[' textval ']'
  645.     | PB '[' textval ']'
  646.     | PC '[' textval ']'
  647.     | PL '[' colorval ']'
  648.     | PW '[' textval ']'
  649.     | RE '[' textval ']'
  650.     | RG                  { PRINTOFF=TRUE; }    /* ReGion */
  651.         pointlist 
  652.                       { PRINTOFF=FALSE; }
  653.     | RO '[' textval ']'
  654.     | SC                  { PRINTOFF=TRUE; }    /* SeCure?? */
  655.         pointlist 
  656.                       { PRINTOFF=FALSE; }
  657.     | SL                  { PRINTOFF=TRUE; }    /* SeLect?? */
  658.         pointlist 
  659.                       { PRINTOFF=FALSE; }
  660.     | SO '[' textval ']'
  661.     | SZ '[' inumval ']'
  662.     | TB                  { PRINTOFF=TRUE; }    /* TerrBlack */
  663.         pointlist 
  664.                       { PRINTOFF=FALSE; }
  665.     | TC '[' inumval ']'
  666.     | TE '[' tripleval ']'
  667.     | TM '[' textval ']'
  668.     | TR                { PRINTOFF=TRUE; }    /* ?? */
  669.         pointlist 
  670.                       { PRINTOFF=FALSE; }
  671.     | TW                  { PRINTOFF=TRUE; }    /* TerrWhite */
  672.         pointlist 
  673.                       { PRINTOFF=FALSE; }
  674.     | US '[' textval ']'
  675.     | V  '[' inumval ']'
  676.     | VW                  { PRINTOFF=TRUE; }    /* VieW?? */
  677.         pointlist 
  678.                       { PRINTOFF=FALSE; }
  679.     | W                  { printf(";W"); }
  680.         pointlist 
  681.     | WL '[' realval ']'
  682.     | WR '[' textval ']'
  683.     | WS '[' textval ']'
  684.         | UNKNOWN '[' textval ']' {printf("\nUNKNOWN Command\n");}
  685.     ;
  686. %%
  687.  
  688. #include <stdio.h>
  689.  
  690. #undef    YYSSIZE
  691. #define    YYSSIZE    2048
  692.  
  693. #define    YYSTATIC
  694.  
  695. extern char yytext[];
  696. extern int column;
  697.  
  698. yyerror(s)
  699. char *s;
  700. {
  701.     fflush(stdout);
  702.     errcnt++;
  703.     printf("\nError %s count=%d col=%d\n", s, errcnt, column);
  704. }
  705. SHAR_EOF
  706. fi
  707. exit 0
  708. #    End of shell archive
  709.